<template>
  <div>
    <el-container>
      <el-aside>
        <el-row class="tac">
          <el-col>
            <el-menu
              default-active="2"
              class="el-menu-vertical-demo"
              @open="handleOpen"
              @close="handleClose"
              background-color="#545c64"
              text-color="#fff"
              active-text-color="#ffd04b"
              router>
              <el-menu-item index="manage"><i class="el-icon-menu"></i>首页</el-menu-item>
              <el-submenu index="1">
                <template slot="title">
                  <i class="el-icon-document"></i>
                  <span>信息管理</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="Syinfo">基本信息</el-menu-item>
                  <el-menu-item index="stuinfo">学生信息</el-menu-item>
                  <el-menu-item index="houseinfo">宿舍信息</el-menu-item>
                </el-menu-item-group>
              </el-submenu>

              <el-submenu index="2">
                <template slot="title">
                  <i class="el-icon-plus"></i>
                  <span>来访登记</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="1-1">选项1</el-menu-item>
                  <el-menu-item index="1-2">选项2</el-menu-item>
                </el-menu-item-group>
              </el-submenu>

              <el-submenu index="3">
                <template slot="title">
                  <i class="el-icon-sold-out"></i>
                  <span>财产管理</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="1-1">个人财产登记</el-menu-item>
                  <el-menu-item index="1-2">宿舍报修</el-menu-item>
                </el-menu-item-group>
              </el-submenu>

              <el-submenu index="4">
                <template slot="title">
                  <i class="el-icon-setting"></i>
                  <span>系统管理</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="1-1">注册用户</el-menu-item>
                  <el-menu-item index="1-2">注销用户</el-menu-item>
                  <el-menu-item index="1-2">修改密码</el-menu-item>
                </el-menu-item-group>
              </el-submenu>
            </el-menu>
          </el-col>
        </el-row>
      </el-aside>
      <el-main><carousel></carousel></el-main>
    </el-container>
  </div>
</template>

<script type="text/ecmascript-6">
  import carousel from '../carousel/carousel.vue';
  import ElMain from '../../../node_modules/element-ui/packages/main/src/main.vue';
  import ElAside from '../../../node_modules/element-ui/packages/aside/src/main.vue';
  import ElContainer from '../../../node_modules/element-ui/packages/container/src/main.vue';
  import ElCol from 'element-ui/packages/col/src/col';
  import ElRow from 'element-ui/packages/row/src/row';

  export default {
    components: {
      ElRow,
      ElCol,
      ElContainer,
      ElAside,
      ElMain,
      carousel
    },
    methods: {
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      }
    }
  };
</script>

<style scoped lang="less" rel="stylesheet/less">
  .el-aside {
    background-color: #545c64;
    width: 200px!important;
    color: #333;
    text-align: center;
    line-height: 200px;
  }

  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }
</style>
